
function navigation(){
    $.ajax({
        type: 'get',
        url: 'http://www.xiongmaoyouxuan.com/api/column/3183',
        
        success: function (result) {
            if (result.code == 200) {
                // console.log(result);
                result.data
                Panda(result.data)
            }
        }
    })
}

function  Panda(i){
    // console.log(i);
    
    
    let tate ={
        carts:i
    }
    // console.log(tate);
    let htmlStr1 = template('daoHang1', tate)
    // console.log(htmlStr1);
    $('.bnr').html(htmlStr1)

}



$.ajax({
    type: 'get',
    url: 'http://www.xiongmaoyouxuan.com/api/column/3183/items',
    data: {
        start:0
    },
    success: function (result) {
        if (result.code == 200) {
            console.log(result);
            shopping(result.data.list)
        }
    }
})
function shopping (i){
    let data = {
        cert:i
    }
    console.log(data);
    let htmlStr1 = template('prods', data)
    console.log(htmlStr1);
    $('.cie_a1').html(htmlStr1)
}



/**
 * 加载添加到详情页
 */

 function addCart(id) {
    
    console.log(id);
    let cartListStr = localStorage.getItem('CARTLIST')
    let cartList = JSON.parse(cartListStr) || []
    cartList.unshift(id)
    localStorage.setItem('CARTLIST', JSON.stringify(cartList))
    location.href = './cart.html'

}



// 点击渲染数据
function onRender(t,i){
    console.log(t,i);
    $(t).addClass('mg').siblings().removeClass()
    let url = 'http://www.xiongmaoyouxuan.com/api/sub_column/' + i + '/items'
	$.ajax({
		type: 'get',
		url,
		data: {
			start: 0
		},
		success: function(Accumulate) {
			if (Accumulate.code == 200) {
				colours(Accumulate.data.list)
			}
		}
	})
}
function colours(i) {
	let date = {
		cert:i.splice(0,16)
	}
	let he =template('prods', date)
	$('.cie_a1').html(he)
}


//点击查看更多
let cumulative = 0
//点击查看更多
function onView() {
    // console.log(222);
	cumulative += 20
	let start = cumulative
	$.ajax({
		type: 'get',
		url: 'http://www.xiongmaoyouxuan.com/api/tab/1/feeds',
		data: {
			start,
			sort: 0
		},
		success: function(Accumulate) {
			if (Accumulate.code == 200) {
				rendering(Accumulate)
			}
		},

	})
}


//更多商品渲染
function rendering(i) {

	let srt = i.data.list
	let data = {
		cert: srt.splice(0, 16)
	}

	let htmlStr3 = template('prot', data)
	// console.log(htmlStr3)
	$('.cie_a1').append(htmlStr3)
}





// 跳转


function homepage(){
    location.href='./index.html'
}

function supplemental2() {
    location.href = './Top-jump.html'
}
function supplemental3() {
    location.href = './TopSwitch-two.html'
}




navigation()